﻿using System;
using System.Activities;
using Reactor.Messages.Events.Adoptions;
using Reactor.Workflow.Activities;

namespace Reactor.ServiceGrid.Workflows.Activities
{
    public class ReceiveAdoptedEventToResumeTransfer : ReceiveMessage<ServiceAdopted>
    {
        public OutArgument<Guid> ServiceInstanceIdentifier { get; set; }

        protected override void OnResumeBookmark(NativeActivityContext context, Bookmark bookmark, object obj)
        {
            base.OnResumeBookmark(context, bookmark, obj);

            // Extract ServiceInstanceIdentifier
            context.SetValue(ServiceInstanceIdentifier, ((ServiceAdopted)obj).ServiceInstanceIdentifier);
        }
    }
}
